import grails.util.GrailsUtil
import com.afb.User;
//import com.empresa.Equipament;
//import com.empresa.Invoice;
//import com.empresa.Reservation;


class BootStrap {

     def init = { servletContext ->

                def userNumber = 10;

                def roles = ["Registered", "Administrator"];

		def admin = new User(login:"admin",
			password:"pass",
			role:"Administrator",
			name:"Cris",
			mobile:"123123123",
                        email:"cristiano_manuel@hotmail.com",
			tel:"123123123",
			address:"rua...")
		admin.save()
                
        
		def user;
		for (int i in 0..userNumber-1) {
			user = new User(
				login:"user"+i,
				password:"pass"+i,
//				role:roles[random.nextInt(2)],
				role:"Registered",
				name:"user "+i,
				mobile:"123123123",
                                email:"tanovsky@gmail.com",
				tel:"123123123",
				address:"rua...")
			user.save();
		}

     }
     def destroy = {
     }
} 